home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Views / Pane.h < prev    next >
Text File  |  1997-06-28  |  917b  |  50 lines

  1. // Pane.h
  2.  
  3. #ifndef Pane_h
  4. #define Pane_h
  5.  
  6. #ifndef Rectangle_h
  7. #include "Rectangle.h"
  8. #endif
  9.  
  10. class View;
  11. class Sizeable;
  12. class RegionObject;
  13. class WindowObject;
  14.  
  15. class Pane
  16.   {
  17.     private:
  18.         WindowObject *window;
  19.         Rectangle bounds;
  20.         View *view;
  21.  
  22.     protected:
  23.         void MapTo( WindowObject& );
  24.         void Unmap();
  25.  
  26.         void SetBounds( Rectangle );
  27.         
  28.     public:
  29.         Pane();
  30.         ~Pane();
  31.         
  32.         View& operator*() const                    { Assert( view != 0 ); return *view; }
  33.         View *operator->() const                { Assert( view != 0 ); return view; }
  34.         
  35.         const Sizeable& Size() const;
  36.         
  37.         bool IsEmpty() const                        { return view == 0; }
  38.         
  39.         void SetView( View& );
  40.         void ClearView();
  41.         
  42.         bool Mapped() const                        { return window != 0; }
  43.         WindowObject& Window() const            { Assert( window != 0 ); return *window; }
  44.         const Rectangle& Bounds() const        { Assert( window != 0 ); return bounds; }
  45.         
  46.         virtual void Clip( RegionObject& ) const = 0;
  47.   };
  48.  
  49. #endif
  50.